<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/8/9
  Time: 8:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
    <script src="<c:url value='js/jquery-1.8.2.js'/>"></script>
</head>
    <script>
        function jg(obj){
            a=obj.value;
            b=document.getElementById("price").value;
            document.getElementById("sp").value=a*b;
        }
    </script>
<body>
    <center>
        <form action="<c:url value='/saveOrder.do'/>" method="post">
            <h1>订单详情</h1>
            <p align="right">欢迎您${rub.truename}</p>
        <table border="1" rules="all">
            <tr align="center" bgcolor="#ffc0cb">
                <td></td>
                <td>
                    商品名称
                </td>
                <td>
                    商品产地
                </td>
                <td>
                    商品库存
                </td>
                <td>
                    商品单价
                </td>
                <td>
                    购买数量
                </td>
                <td>
                    订单总价
                </td>
            </tr>
            <tr align="center" bgcolor="#ffc0cb">
                <td></td>
                <td>
                    ${pb.name}
                </td>
                <td>
                    ${pb.price}
                </td>
                <td>
                    ${pb.stock}
                </td>
                <td>
                    <input type="hidden" id="price" value="${pb.price}"/>${pb.price}
                </td>
                <td>
                    <input type="number" max="${pb.stock}" min="0" onchange="jg(this)" name="product_quantity" >
                </td>
                <td>
                    <input type="text" name="order_total" id="sp" readonly>
                </td>
            </tr>
            <tr align="center">
                <td colspan="33">
                    <input type="submit" value="购买"/>
                    <a href="<c:url value='getProList.do'/>"><button type="button">返回</button></a>
                </td>
            </tr>
        </table>
        </form>
    </center>
</body>
</html>
